<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../assets/font/iconfont.css">
    <style>
        body{
            padding-bottom: 800px;
            padding-left: 30px;
        }
        .dailog-box{
            position: fixed;
            top: 0px;
            left: 0px;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            font-size: 14px;
            color: #666;
            display: none;
        }
        .content{
            background-color: white;
            display: inline-block;
            padding: 0px 24px 30px 24px;
            position: absolute;
            top: 30%;
            left: 50%;
            /* %相对元素本身 */
            transform: translate(-50%,-50%);
            border-radius: 12px;
            box-shadow: 0 0 4px #999;
        }
        .header{
            border-bottom: 1px dashed #aaa;
            line-height: 3;
            margin-bottom: 16px;
            text-align: right;
            position: relative;
            
        }
        .header .iconfont{
            position: absolute;
            left: 50%;
            top: 0px;
            transform: translate(-50%,-50%);
            width: 40px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            color: white;
            font-size: 20px;
            background-color: #31d4da;
            border-radius: 50%;
        }
        .header span{
            user-select: none;
            cursor: pointer;
        }
        .header span:active{
            color: brown;
        }
        .body .item{
            padding: 4px 0px;
        }
        .body .item label::before{
            content: "* ";
            color: red;
        }
        .body .item label::after{
            content: " : ";
            font-weight: bold;
            padding-right: 6px;
        }
        .body .item input[type="text"]{
            outline: none;
            border:1px solid #999;
            line-height: 1.4;
            border-radius: 4px;
        }
        .body .item.btn{
            margin-top: 16px;
            text-align: center;
        }
        .body .item.btn input[type="button"]{
            cursor: pointer;
            background-color: #428bca;
            border: unset;
            color: white;
            padding: 8px 24px;
            border-radius: 8px;
            box-shadow: 0 6px 0 #2c6597;
        }
        .body .item.btn input[type="button"]:active{
            transform: translate(0px,4px);
            box-shadow: 0 2px 0 #2c6597;
        }
    </style>
</head>
<body>
    <div id="app">
        
        <input type="button" value="openDailog" @click="type='block'">


        <div class="dailog-box" v-bind:style="`display:${type};`" @click="type='none'">

            <div class="content" @click.stop>
                <div class="header">
                    <i class="iconfont icon-edit"></i>
                    <span @click="type='none'">关闭</span>
                </div>
                <div class="body">
                    <div class="item">
                        <label for="nikename">昵称</label>
                        <input type="text">
                    </div>
                    <div class="item">
                        <label for="phone">手机</label>
                        <input type="text">
                    </div>
                    <div class="item">
                        <label for="address">地址</label>
                        <input type="text">
                    </div>
                    <div class="item btn">
                        <input type="button" value="确认提交" @click="type='none'">
                    </div>
                </div>
            </div>

        </div>


    </div>
    <script type="module">
        // 加载 Vue3 的ESM 模块文件
        import { createApp } from "../assets/vue3/vue.esm-browser.js"
        createApp({
            data(){
                return {
                    type:"none"
                }
            }
        }).mount("#app")
    </script>
</body>
</html>